package com.zr.repertory.affiliation.controller;

import com.zr.repertory.affiliation.model.pojo.QueryLocationVo;
import com.zr.repertory.affiliation.model.pojo.WareLocation;
import com.zr.repertory.affiliation.service.WareLocationService;
import com.zr.utils.result.ResultBuilderUtil;
import com.zr.utils.result.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName WareLocationController
 * @Description TODO
 * @Author Jiakui_Ma
 * @Date 2019/11/22 6:21
 */
@RestController
@CrossOrigin
@RequestMapping("StorageBin")
public class WareLocationController {

    @Autowired
    private WareLocationService wareLocationService;

    /**
     * 根据库房id和库区id集合查询库位
     * @param queryLocationVo
     * @return
     */
    @PostMapping("WareHouseAndStorageSectionId")
    public ResultUtil queryWareLocation(@RequestBody QueryLocationVo queryLocationVo){

        List<WareLocation> wareLocationList = wareLocationService.queryWareLocation(queryLocationVo);

        return ResultBuilderUtil.success(wareLocationList);
    }
}
